'use strict';

var _reactDom = require('react-dom');

var _reactDom2 = _interopRequireDefault(_reactDom);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactRouter = require('react-router');

var _radium = require('radium');

var _useBasename = require('history/lib/useBasename');

var _useBasename2 = _interopRequireDefault(_useBasename);

var _LoginView = require('./login/LoginView');

var _LoginView2 = _interopRequireDefault(_LoginView);

var _RegisterView = require('./register/RegisterView');

var _RegisterView2 = _interopRequireDefault(_RegisterView);

var _lightbiFrontWidget = require('lightbi-front-widget');

var _lightbiFrontProject = require('lightbi-front-project');

var _lightbiFrontUtils = require('lightbi-front-utils');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function withBasename(history, dirname) {
  return (0, _useBasename2.default)(function () {
    return history;
  })({ basename: '/' + dirname });
};

_reactDom2.default.render(_react2.default.createElement(
  _radium.StyleRoot,
  { className: 'full-height' },
  _react2.default.createElement(
    _reactRouter.Router,
    { history: withBasename(_reactRouter.browserHistory, "") },
    _react2.default.createElement(
      _reactRouter.Route,
      { path: _lightbiFrontUtils.IN_DEPLOY_URI == '' ? '/entrance' : _lightbiFrontUtils.IN_DEPLOY_URI + '/entrance' },
      _react2.default.createElement(_reactRouter.Route, { path: 'login', component: _LoginView2.default }),
      _react2.default.createElement(_reactRouter.Route, { path: 'register', component: _RegisterView2.default }),
      _react2.default.createElement(_reactRouter.Route, { path: 'forgetPassword', component: _lightbiFrontProject.ForgetPasswordView }),
      _react2.default.createElement(_reactRouter.Route, { path: '404', component: _lightbiFrontWidget.NotFoundView }),
      _react2.default.createElement(_reactRouter.Redirect, { from: '*', to: '/404' })
    )
  )
), document.getElementById("content"));